<?php

function percentOf($retail, $cost)
{
 $profit = ($retail - $cost);
 $percent = ($profit / $retail);
 $totalpercent = ($percent * 100);
 echo 'Total Retail<br/>$';
 echo $retail;
 echo '<br/>Subtract Total Cost<br/>$';
 echo $cost;
 echo '<br/>Equals Profit $';
 echo $profit;
 echo '<br/>Percent Total=';
 echo $percent;
 echo '% <br/>You made a ';
 echo $totalpercent;
 echo ' percent profit';

 } // end function percentOf()
?>